﻿using Best.SmartCms.Dto.Enums;
using Best.SmartCms.Domain.Security;

namespace Best.SmartCms.Service.Common
{
    public class WorkContext : IService
    {
        /// <summary>
        /// 来源系统
        /// </summary>
        public RequestSourceEnum Source { get; set; }

        /// <summary>
        /// 当前用户
        /// </summary>
        public User CurrentUser { get; set; }

        /// <summary>
        /// 用户Id
        /// </summary>
        public long UserId => CurrentUser.Id;

        /// <summary>
        /// 用户名称
        /// </summary>
        public string UserName => CurrentUser.UserName;
        /// <summary>
        /// 电话
        /// </summary>
        public string Phone => CurrentUser.Phone;
        /// <summary>
        /// 真实姓名
        /// </summary>
        public string Name => CurrentUser.Name;

    }
}
